package cn.net.yugu.doraemon.common.dal.entity;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * 具备创建者、修改者的实体类
 *
 * @author xiangzhurui
 * @version 2023/2/19 22:26:33
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public abstract class BaseAdminDeletableEntity extends BaseDeletableEntity {

    private static final long serialVersionUID = 7128012687199421740L;

    protected String createdBy;

    protected String updatedBy;

    @Override
    public void setCreatedDefaultValue() {
        super.setCreatedDefaultValue();
        if (this.createdBy == null) {
            this.createdBy = "system";
        }
    }

    @Override
    public void setUpdatedDefaultValue() {
        super.setUpdatedDefaultValue();
        if (this.updatedBy == null) {
            this.updatedBy = "system";
        }
    }

    @Override
    public void setDeletedDefaultValue() {
        super.setDeletedDefaultValue();
    }

}
